<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>业务合同管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>manage/css/addTravel.css"></link>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>manage/css/actionErrors.css"></link>
		<script language="javascript" type="text/javascript"
			src="<%=basePath%>datemaker/WdatePicker.js">
		</script>
		<script type="text/javascript" src="manage/js/jquery.js"></script>
		<script type="text/javascript" src="manage/js/addbg.js"></script>

	</head>
	<center>
	<body>

		<s:form action="alterTrafficContract" namespace="/" method="post"
			enctype="multipart/form-data">
		<table >
			<thead>
				<tr>
					<td colspan="4" align="center">修&nbsp;改&nbsp;合&nbsp;同&nbsp;信&nbsp;息</td>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>
						合&nbsp;&nbsp;同&nbsp;&nbsp;名
					</td>
					<td>
						<s:textfield name="contract.name"
							value="%{contract.name}"></s:textfield>
					</td>
				&nbsp;&nbsp;&nbsp;&nbsp;
					<td>
						客&nbsp;&nbsp;户&nbsp;&nbsp;名
					</td>
					<td>
						<s:textfield name="contract.customer"
							value="%{contract.customer}"></s:textfield>
					</td>
				</tr>
				<tr>
					<td>
						签&nbsp;订&nbsp;时&nbsp;间
					</td>
					<td>
						<input type="text" name="contract.date"
							value="<s:date name="contract.date" format="yyyy-MM-dd"/>"
							class="Wdate" onClick="WdatePicker()" id="contractDate" />
					</td>
				&nbsp;&nbsp;&nbsp;&nbsp;
					<td>
						合&nbsp;同&nbsp;概&nbsp;述
					</td>
					<td>
						<s:textfield name="contract.summarize"
							value="%{contract.summarize}"></s:textfield>
					</td>
				</tr>
				<tr>
					<td>
						合&nbsp;同&nbsp;金&nbsp;额
					</td>
					<td>
						<s:textfield name="contract.amount"
							value="%{contract.amount}"></s:textfield>
					</td>
				&nbsp;&nbsp;&nbsp;&nbsp;
					<td>
						开&nbsp;始&nbsp;时&nbsp;间
					</td>
					<td>
						<input type="text" name="contract.start" 
							value="<s:date name="contract.start" format="yyyy-MM-dd"/>"
							class="Wdate" onClick="WdatePicker()" id="contractStart"/>
					</td>
				</tr>
				<tr>
					<td >
						结&nbsp;束&nbsp;时&nbsp;间
					</td>
					<td>
						<input type="text" name="contract.end"
							value="<s:date name="contract.end" format="yyyy-MM-dd"/>"
							class="Wdate" onClick="WdatePicker()" id="contractEnd" />
					</td>
				&nbsp;&nbsp;&nbsp;&nbsp;
				
					<td >
						上&nbsp;传&nbsp;合&nbsp;同
					</td>
					
					<td style="font-size:8px">
						<s:file name="upload" accept="image/*"/>
					
						<%
							String filePath = request.getAttribute(
										"contract.url").toString();
								String contextPath = request.getRealPath(
										"/");
								String url = filePath.replaceFirst(
										contextPath.replaceAll("\\\\", "\\\\\\\\"), "")
										.replaceAll("\\\\", "/");
						%>
						已上传合同：<%=url%>
						<s:hidden name="contract.url"
							value="%{contract.url}"></s:hidden>
					</td>
				</tr>
				</tbody>
				<tfoot>
				<tr>
					<td colspan="4" align="center">
						<input class="submit" type="submit" value="提交"  />
    					<input class="reset" type="reset" value="重置" />
						<input class="return" type="button" value="返回" onclick="window.history.back();" />
						<s:actionerror cssClass="errors" />
					</td>
				</tr>
				</tfoot>
			</table>
			<s:hidden name="contractId" value="%{contractId}"></s:hidden>
		</s:form>
		
	</body>
</center>
</html>
